﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Search</title>
    <script src="~/Script/jquery-3.3.1.min.js"></script>
    <script src="~/Script/jquery.unobtrusive-ajax.min.js"></script>
    <script type="text/javascript">
        function searchFailed()
        {
            $("#searchresults").html("查询有问题");
        }

    </script>
</head>
<body>
    @using (Html.BeginForm("Search", "Default",new AjaxOptions


    {
        UpdateTargetId= "searchresults",
        InsertionMode=InsertionMode.Replace,
        LoadingElementId= "ajax-loader",
        OnFailure= "searchFailed"




    }))
    {


        <input type="text" name="pname"/>
        <input type="submit" value="Search"/>
        <img  id="ajax-loader" src="@Url.Content("~/images/ajax-loader.gif")" style="display:none"/>
        <div id="searchresults"></div>

    }
</body>
</html>
